//
//  myOrderModel.swift
//  OnceNectar
//
//  Created by Zhang Dream on 2018/6/24.
//  Copyright © 2018年 com.inwhoop. All rights reserved.
//

import Foundation
import MappingAce
import SwiftyJSON

struct myOrderModel:Mapping {
    var actualPayAmount : String?
    var cancelTime :String?
    var carriage :String?
    var courierNumber :String?
    var deliveryAddres :String?
    var deliveryAddressId :String?
    var deliveryTime :String?
    var discountLevel :String?
    var id :String?
    var invoiceContent :String?
    var invoiceTitle :String?
    var invoiceType :String?
    var lastPayTime :String?
    var lastPayTimeL :String?
    var obtainPoint :String?
    var orderNumber :String?
    var payAmount :String?
    var payMethod :String?
    var payTime :String?
    var pgiIds :String?
    var purchaseGoodsInfos :[purcharseModel]?
    var reason :String?
    var receiveTime :String?
   
    var receiver :String?
    var remarks :String?
    var remindDate :String?
    var shippingMethod :String?
    var status :String?

    var statusName :String?
    var submitTime :String?
    var taxpayerIdNo :String?
    var telephoneNumber :String?
    var totalCount :String?
    var traceUrl :String?
    var unitName :String?
    var userId :String?
    var userPet :String?
    var telephone :String?
    var isCommented:String?
}

extension myOrderModel{
    
    mutating func initLabels(arr: [JSON]) {
        
        var xlabers :[purcharseModel] = []
        for object in arr {
            
            let xmodel = purcharseModel(fromDic: object.dictionary! )
            
            xlabers.append(xmodel)
        }
        purchaseGoodsInfos = xlabers
    }
}
